import glob
import os

path=r"images\*.png"
files=glob.glob(path)
m=len(files)
# f_data.write("echo WARNING:Invalid Command\")\n")
std='start '
f_data=open("tmp.py","w+",encoding="utf-8")
f_data.write("import os\nos.system(r\"")
for i in range(0,m):
#    f_data.write(std*((i+1)%2))
    f_data.write("python main.py "+files[i]+" & ")
f_data.write("\")")
f_data.close()

os.system("python tmp.py")

